package demo.controller;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import demo.dao.IAdminDao;
import demo.model.Admin;
import demo.model.AdminDTO;

@RestController
@RequestMapping("admin")
public class AdminController {

	@Resource
	private IAdminDao dao;
	
	@RequestMapping("jinyong.do")
	public int jinyong(Integer id) {
		return dao.jinyong(id);
	}
	
	@RequestMapping("jiejin.do")
	public int jiejin(Integer id) {
		return dao.jiejin(id);
	}
	
	@RequestMapping("login.do")
	public Admin login(Admin a) {
		//登录信息需要存储到session中
		return dao.login(a);
	}
	
	@RequestMapping("editPass.do")
	public int editPass(AdminDTO dto) {
		return dao.editPass(dto);
	}
	
}
